Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EconomistWorldInBriefBridge] Add bridge #2765

Merged
merged 3 commits into from
Jun 5, 2022

Conversation

SqrtMinusOne
Copy link
Contributor

Adding a bridge for The Economist's The world in brief.

It doesn't provide any history or such, so this just fetches the content from that page and optionally splits it into different entries.

@github-actions
Copy link

github-actions bot commented Jun 1, 2022

Pull request artifacts

file last change
EconomistWorldInBrief-pr-context1 2022-06-05, 14:24:11

@dvikan
Copy link
Contributor

dvikan commented Jun 4, 2022

Please explain what a gobbet is. Use mb_strlen and mb_strpos. I think the usage of $today->format('U') in uids causes duplicates in feed readers.

@SqrtMinusOne
Copy link
Contributor Author

Please explain what a gobbet is.

A gobbet is "an extract of text, or image (especially a quotation), provided as a context for analysis, discussion, or translation in an examination".

This word was used in class names on the original page, so I called methods this way for consistency's sake.

Use mb_strlen and mb_strpos

Done.

I think the usage of $today->format('U') in uids causes duplicates in feed readers.

It shouldn't.

The Economist updates this section throughout the day, so in 12 hours half of the "gobbets" may change. Thus, if splitGobbets is set, the uid is the md5 of the gobbet, so that only new gobbets are seen as, in fact, new.

If splitGobbets is not set, it is reasonable to fetch this section only once a day, so the uid is world-in-brief-<timestamp>, where <timestamp> is set to the start of the current day (because of $today->setTime(0, 0, 0, 0);). So only one entry from "The world in brief" per day.

I've been using this bridge with tt-rss and elfeed for around a month without any issues.

@dvikan dvikan merged commit 7256d11 into RSS-Bridge:master Jun 5, 2022
@dvikan
Copy link
Contributor

dvikan commented Jun 5, 2022

Thank you for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants